package com.doradance.app;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RadioButton;

import com.doradance.R;
import com.doradance.app.activity.ActivityFragment;
import com.doradance.app.activity.ActivityHomeFragment;
import com.doradance.app.curriculum.CurriculumFragment;
import com.doradance.app.home.HomeFragment;
import com.doradance.app.mine.MIneHomeFragment;
import com.doradance.app.mine.MineFragment;
import com.pachong.android.framework.commonui.RadioButtonBottomTabFragment;
import com.pachong.android.frameworkbase.customviews.BadgeRadioButton;


import java.util.ArrayList;
import java.util.List;

/**
 * 主界面的fragment
 *
 * @Author: PV
 * @E-mail: pengveivei@sina.cn
 * @CreateDate: 2016/6/24 15:47
 * @Version: 1.0.0
 */
public class MainBottomFragment extends RadioButtonBottomTabFragment {


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        return view;
    }

    @Override
    public List<PageInfo> createPages() {

        Fragment main1Frag = new HomeFragment();
        Fragment main2Frag = new ActivityHomeFragment();
        Fragment main3Frag = new ActivityFragment();
        Fragment main4Frag = new MIneHomeFragment();
        Fragment[] fragments = new Fragment[]{main1Frag, main2Frag, main3Frag, main4Frag};
        String[] TITLES = new String[]{"首页", "课程", "活动", "我的"};
        final int[] ICONS = new int[]{R.drawable.bg_buttom_home, R.drawable.bg_buttom_curriculum, R.drawable.bg_buttom_activity, R.drawable.bg_buttom_mine};

        List<PageInfo> pageList = new ArrayList<>();
        for (int i = 0; i < TITLES.length; i++) {
            pageList.add(new PageInfo(fragments[i], TITLES[i], ICONS[i]));
        }

        return pageList;
    }
}
